package com.xiaoming.backend.result.exception;

import com.xiaoming.backend.result.exception.error.AppError;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppErrorException extends RuntimeException {
    private String code;
    private String errorMsg;

    public AppErrorException(AppError error){
        this.code = error.getCode();
        this.errorMsg = error.getErrorMsg();
    }
}
